package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SysAttendance;
import com.ruoyi.system.mapper.SysAttendanceMapper;
import com.ruoyi.system.service.ISysAttendanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 考勤Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-01-04
 */
@Service
public class SysAttendanceServiceImpl implements ISysAttendanceService 
{
    @Autowired
    private SysAttendanceMapper sysAttendanceMapper;

    /**
     * 查询考勤
     * 
     * @param id 考勤ID
     * @return 考勤
     */
    @Override
    public SysAttendance selectSysAttendanceById(Long id)
    {
        return sysAttendanceMapper.selectSysAttendanceById(id);
    }

    /**
     * 查询考勤列表
     * 
     * @param sysAttendance 考勤
     * @return 考勤
     */
    @Override
    public List<SysAttendance> selectSysAttendanceList(SysAttendance sysAttendance)
    {
        return sysAttendanceMapper.selectSysAttendanceList(sysAttendance);
    }

    @Override
    public int saveSysAttendance(SysAttendance sysAttendance) {
        return sysAttendanceMapper.saveSysAttendance(sysAttendance);
    }

    /**
     * 新增考勤
     * 
     * @param sysAttendance 考勤
     * @return 结果
     */
    @Override
    public int insertSysAttendance(SysAttendance sysAttendance)
    {
        return sysAttendanceMapper.insertSysAttendance(sysAttendance);
    }

    /**
     * 修改考勤
     * 
     * @param sysAttendance 考勤
     * @return 结果
     */
    @Override
    public int updateSysAttendance(SysAttendance sysAttendance)
    {
        return sysAttendanceMapper.updateSysAttendance(sysAttendance);
    }

    /**
     * 批量删除考勤
     * 
     * @param ids 需要删除的考勤ID
     * @return 结果
     */
    @Override
    public int deleteSysAttendanceByIds(Long[] ids)
    {
        return sysAttendanceMapper.deleteSysAttendanceByIds(ids);
    }

    /**
     * 删除考勤信息
     * 
     * @param id 考勤ID
     * @return 结果
     */
    @Override
    public int deleteSysAttendanceById(Long id)
    {
        return sysAttendanceMapper.deleteSysAttendanceById(id);
    }

    /**
     * 通过月查询
     *
     * @param date
     * @return 结果
     */
    @Override
    public List<SysAttendance> selectSysAttendanceByMonth(String date) {return sysAttendanceMapper.selectSysAttendanceByMonth(date);}

    /**
     * 通过班组ID查询
     *
     * @param classID
     * @param month
     * @return 结果
     */
    @Override
    public List<SysAttendance> selectSysAttendanceByClass(String classID,String month) {return sysAttendanceMapper.selectSysAttendanceByClass(classID,month);}
}
